//=============================================================================
// test.js
//=============================================================================
 
/*:
 * @plugindesc canvas测试插件
 * @author 3A
 *
 * @param centent1
 * @desc 测试参数
 * @default hello world
 *
 * @help
 * 
 * 这里是帮助信息
 *
 */

function ask(question,answer)
{
    return prompt(question,"")==answer;
}

function backToGame()
{
    document.getElementById("GameCanvas").style.visibility="visible";
    document.getElementById("UpperCanvas").style.visibility="visible";
    document.getElementById("GameVideo").style.visibility="visible";
}

function canvasTest()
{
    console.log('hahaha');
    var canvas = document.createElement('canvas');
    //var GameCanvas = document.getElementById('GameCanvas');
    document.getElementById("GameCanvas").style.visibility="hidden";
    document.getElementById("UpperCanvas").style.visibility="hidden";
    document.getElementById("GameVideo").style.visibility="hidden";
    document.body.appendChild(canvas);

    canvas.id='newCanvas';
    canvas.style.zIndex=100;
    canvas.width = 1000;
    canvas.height = 500;
    canvas.style.backgroundColor = '#FF0000';

    var oc= canvas;
    var ogc=canvas.getContext('2d');
    oc.onmousedown = function(ev)
    {
        var ev=ev || window.event;
        ogc.moveTo(ev.clientX-oc.offsetLeft,ev.clientY-oc.offsetTop);
        document.onmousemove = function(ev)
        {
            var ev = ev || window.event;
            ogc.lineTo(ev.clientX-oc.offsetLeft,ev.clientY-oc.offsetTop);
            ogc.stroke();
        };
        document.onmouseup = function()
        {
            document.onmousemove = null;
            document.onmouseup = null;
        };

    }
}